package com.kaishengit.service;

import com.kaishengit.dao.DocumentDao;
import com.kaishengit.entity.Document;
import com.kaishengit.util.Page;

public class DocumentService {
	
	DocumentDao dao = new DocumentDao();
	public Page<Document> findAll(String proId,int pageNum) {
		
		Page<Document> page = new Page<Document>(3,dao.getCount(),pageNum);
		return dao.findAll(proId,page);
	}

	public void save(Document d) {
		dao.save(d);
	}

	public Document findById(String id) {
		return dao.findById(id) ;
	}

	public void update(String id, String title, String content) {
		dao.update(id,title,content);
	}

	public void delete(String id) {
		dao.delete(id);
	}
	
}
